﻿package org.leles.aom.objects
{
	import com.adobe.serialization.json.JSON;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import org.leles.aom.Activity;
	/**
	 * ...
	 * @author Bruno Leles
	 */
	public class Channel extends ActivityObject
	{
		
		public function Channel(activity:Activity = null) 
		{
			super(activity);
		}
		
		public function cancelSendFile(){}
		public function enterIM(){}
		public function initialize(){}
		public function sendData(data:Object):void
		{
			var strData = JSON.encode( data );
			activity.callDriverMethod('Channel_SendData', [strData] );
		}
		public function sendFile(){}
		public function sendIM(){}
		public function sendIMAsUser() { }
		
		//
		// static EventDispatcher Suport
		//
		/*
		private static var dispatcher:EventDispatcher;
		
		private static function init()
		{
			dispatcher = new EventDispatcher();
		}
		
		public static function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false) : void
		{
			dispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
		}
		
		public static function dispatchEvent (event:Event) : Boolean
		{
			return dispatcher.dispatchEvent(event);
		}
		
		public static function hasEventListener (type:String) : Boolean
		{
			return dispatcher.hasEventListener(type);
		}

		public static function removeEventListener (type:String, listener:Function, useCapture:Boolean = false) : void
		{
			dispatcher.removeEventListener(type, listener, useCapture);
		}
		
		public static function willTrigger (type:String) : Boolean
		{
			return dispatcher.willTrigger(type);
		}
		*/
	}

}